package com.dili.dd.gpi.enums;

/**
 * 申请的方式。网页申请，还是接口申请
 * User: zhaoYuan
 * Date: 14-9-9
 * Time: 下午5:08
 */
public enum ApplyType implements BaseEnumInterface {

    API(1,"接口申请"),PAGE(2,"网页申请");
    private int val;

    private String desc;

    ApplyType(int val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    public int getValue() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static ApplyType getByValue(int val){
        ApplyType[] values = ApplyType.values();
        for (ApplyType value : values) {
            if(value.getValue() == val){
                return value;
            }
        }
        throw new RuntimeException("值为" + val + "的枚举值，在" + ApplyType.class + "中不存在");
    }

}
